export default {
  mounted() {
    if ((document.documentElement.clientWidth || document.body.clientWidth) <= 1024) {
      this.$refs.sidebar.style.width = '64px'
      this.$refs.content.style.marginLeft = '64px'
      this.isCollapse = true
    }
    this._resizeWin = () => {
      let winWidth = document.documentElement.clientWidth || document.body.clientWidth
      if (winWidth <= 1024) {
        this.$refs.sidebar.style.width = '64px'
        this.$refs.content.style.marginLeft = '64px'
        this.isCollapse = true
      } else {
        this.$refs.sidebar.style.width = '200px'
        this.$refs.content.style.marginLeft = '200px'
        this.isCollapse = false
      }
    }
    window.addEventListener('resize', this._resizeWin)
  },
  beforeDestroy() {
    window.removeEventListener('resize', this._resizeWin)
  }
}
